ES6 新功能


Posted by Rich on 2021-04-25

let name = rich
console.log(`hello ${name}`)
//output: hello rich
var  obj = {
    a:1,
    b:2
}
var obj2 = {
    ...obj,   ///destructuring
    c: 3
}
var {a, ...rest} = obj2 //rest parameters
console.log(rest)
//output:{b: 2, c: 3}









Related Posts

 Babel

Babel

同步(Sync)& 非同步(Async) 、回呼(Callback)、Promise + then() + catch()、async + await + try + catch

同步(Sync)& 非同步(Async) 、回呼(Callback)、Promise + then() + catch()、async + await + try + catch

[ 筆記 ] 交換資料 - XMLHttpRequest、CORS、JSONP

[ 筆記 ] 交換資料 - XMLHttpRequest、CORS、JSONP


Comments